/*
 * @Author: miaoyongbin
 * @Date: 2022-07-28 16:07:29
 * @LastEditTime: 2022-07-28 16:08:21
 * @Description:
 *
 * Copyright (c) 2022 by miaoyongbin, All Rights Reserved.
 */
import request from '@/utils/request'
import { camelCaseObject } from '@/libs/object'

const AUTH_PREFIX_V1 = `/api/v1/ticket`

export function getTicketLogList(params) {
  return request.get(`${AUTH_PREFIX_V1}/logs`, { params }).then(res => camelCaseObject(res))
}

export function getTicketLogListByPage(params) {
  return request.get(`${AUTH_PREFIX_V1}/logs/page`, { params }).then(res => camelCaseObject(res))
}

export function getTicketLog(orderId) {
  return request.get(`${AUTH_PREFIX_V1}/logs/${orderId}`).then(res => camelCaseObject(res))
}

export function createTicketLog(params) {
  return request.post(`${AUTH_PREFIX_V1}/logs`, params).then(res => camelCaseObject(res))
}

export function updateTicketLog(orderId, params) {
  return request.put(`${AUTH_PREFIX_V1}/logs/${orderId}`, params).then(res => camelCaseObject(res))
}

export function deleteTicketLog(orderId) {
  return request.delete(`${AUTH_PREFIX_V1}/logs/${orderId}`).then(res => camelCaseObject(res))
}

